<?php

// replace with HTML entities
// output: '&lt;div width=&quot;200&quot;&gt;
//          This is a div&lt;/div&gt;'
  $abc = "<script>alert('hello')</script>";
echo '<pre style="">';
echo htmlentities($abc);
echo '</pre>';

 $html = '<div width="200">This is a div</div>';
echo '<pre>';
echo htmlentities($html);
echo '</pre>';

// replace line breaks with <br/>s
// output: 'This is a bro<br />
//            ken line'
$lines = 'This is a bro
            ken line';
echo nl2br($lines);

?>
<style type="text/css">
  pre{
    background-color:lightyellow;border:1px solid yellow;box-shadow: 2px 4px 6px #808080;
  }
</style>
